import java.util.ArrayList;
import java.util.List;

public class Generate {
    public static void main(String[] args) {
//        int[] ints = new int[6];
//        for (int i = 0; i < ints.length; i++) {
//            System.out.println(ints[i]);
//        }
        System.out.println(generate(5));
    }

    /**
     * 杨辉三角
     * @param numRows
     * @return
     */
    public static List<List<Integer>> generate(int numRows) {
        List<List<Integer>> lists = new ArrayList<>();
        int[] ints = new int[numRows+1];
        ints[1]=1;
        for (int i = 1; i <= numRows; i++) {
            ArrayList<Integer> list = new ArrayList<>();
            for (int j = i; j > 0; j--) {
                ints[j]=ints[j-1]+ints[j];
                System.out.println(ints[j]);
                list.add(ints[j]);
            }
            lists.add(list);
        }
        return lists;
    }
}
